let root = resolve_root(root, opts.config)?;
let map = SourceConfigMap::new(opts.config)?;
- let installed_anything = if krates.len() <= 1 {
+ let (installed_anything, scheduled_error) = if krates.len() <= 1 {
install_one(root.clone(), map, krates.into_iter().next(), source_id, vers, opts,
force, true)?;
- true
+ (true, false)
} else {
let mut succeeded = vec![];
let mut failed = vec![];
opts.config.shell().status("\nSummary:", summary.join(" "))?;
}
- !succeeded.is_empty()
+ (!succeeded.is_empty(), !failed.is_empty())
};
if installed_anything {
dst.display()))?;
}
+ if scheduled_error {
+ bail!("some crates failed to install");
+ }
+
Ok(())
}
pkg("bar", "0.0.2");
assert_that(cargo_process("install").args(&["foo", "bar", "baz"]),
- execs().with_status(0).with_stderr(&format!("\
+ execs().with_status(101).with_stderr(&format!("\
[UPDATING] registry `[..]`
[DOWNLOADING] foo v0.0.1 (registry file://[..])
[INSTALLING] foo v0.0.1
Summary: Successfully installed foo, bar! Failed to install baz (see error(s) above).
warning: be sure to add `[..]` to your PATH to be able to run the installed binaries
+error: some crates failed to install
",
home = cargo_home().display())));
assert_that(cargo_home(), has_installed_exe("foo"));